package com.o2o.model.topic;

import java.util.Date;

import com.o2o.base.BaseModel;
import com.o2o.util.TimeUtil;

public class Topic extends BaseModel {

	/**
	 * 主题帖类
	 */
	private static final long serialVersionUID = 4246347065086065643L;

	private long id;
	
	private String topicTitle;//主题帖标题
	
	private String topicString;//主题帖的      “楼主说”
	
	private long topicCreateTime; //创建时间
	
	private long uid;//创建用户id
	
	private String topicUserName;//楼主name
	
	private int topicStatus;//主题帖状态，1为正常，0为删除
	
	private int topicBrowseCount;//浏览次数
	
	private int topicContentCount;//回复次数
	
	private int topicUserCount;//实际参与人数
	
	private int topicGreatCount;//被赞次数
	
	private long productId;//商品id，每个主题帖对应一个商品
	
	private Product product;//主题帖的所有商品
	
	private int topicHot;//主题帖热度
	
	private int categoryNumber;
	
	private int productType;
	
	private int type;
	
	public Date getTopicCreateDate(){
		return TimeUtil.GetDateTimeByStamp(this.topicCreateTime);
	}
	
	//主题帖热度算法
	public Integer getTopicHot() {
//		int hot = topicBrowseCount*1+topicContentCount*3+topicUserCount*3+topicGreatCount*3;
		return topicHot;
	}

	public void setTopicHot(int topicHot) {
		this.topicHot = topicHot;
	}

	public long getId() {
		return id;
	}

	public int getCategoryNumber() {
		return categoryNumber;
	}

	public void setCategoryNumber(int categoryNumber) {
		this.categoryNumber = categoryNumber;
	}

	public int getProductType() {
		return productType;
	}

	public void setProductType(int productType) {
		this.productType = productType;
	}

	public int getType() {
		return type;
	}

	public void setType(int type) {
		this.type = type;
	}

	public int getTopicGreatCount() {
		return topicGreatCount;
	}

	public void setTopicGreatCount(int topicGreatCount) {
		this.topicGreatCount = topicGreatCount;
	}

	public String getTopicUserName() {
		return topicUserName;
	}

	public void setTopicUserName(String topicUserName) {
		this.topicUserName = topicUserName;
	}

	public void setId(long id) {
		this.id = id;
	}

	public String getTopicTitle() {
		return topicTitle;
	}

	public void setTopicTitle(String topicTitle) {
		this.topicTitle = topicTitle;
	}

	public String getTopicString() {
		return topicString;
	}


	public void setTopicString(String topicString) {
		this.topicString = topicString;
	}


	public long getTopicCreateTime() {
		return topicCreateTime;
	}

	public void setTopicCreateTime(long topicCreateTime) {
		this.topicCreateTime = topicCreateTime;
	}

	public long getUid() {
		return uid;
	}

	public void setUid(long uid) {
		this.uid = uid;
	}

	public int getTopicStatus() {
		return topicStatus;
	}
	public void setTopicStatus(int topicStatus) {
		this.topicStatus = topicStatus;
	}
	public Product getProduct() {
		return product;
	}
	public void setProduct(Product product) {
		this.product = product;
	}
	public int getTopicBrowseCount() {
		return topicBrowseCount;
	}

	public void setTopicBrowseCount(int topicBrowseCount) {
		this.topicBrowseCount = topicBrowseCount;
	}

	public int getTopicContentCount() {
		return topicContentCount;
	}


	public void setTopicContentCount(int topicContentCount) {
		this.topicContentCount = topicContentCount;
	}


	public int getTopicUserCount() {
		return topicUserCount;
	}


	public void setTopicUserCount(int topicUserCount) {
		this.topicUserCount = topicUserCount;
	}


	public long getProductId() {
		return productId;
	}


	public void setProductId(long productId) {
		this.productId = productId;
	}


	public Topic() {
		
	}

	public Topic(long id, String topicTitle, String topicString,
			long topicCreateTime, long uid, String topicUserName,
			int topicStatus, int topicBrowseCount, int topicContentCount,
			int topicUserCount, int topicGreatCount, long productId) {
		this.id = id;
		this.topicTitle = topicTitle;
		this.topicString = topicString;
		this.topicCreateTime = topicCreateTime;
		this.uid = uid;
		this.topicUserName = topicUserName;
		this.topicStatus = topicStatus;
		this.topicBrowseCount = topicBrowseCount;
		this.topicContentCount = topicContentCount;
		this.topicUserCount = topicUserCount;
		this.topicGreatCount = topicGreatCount;
		this.productId = productId;
	}

	@Override
	public String toString() {
		return "Topic [id=" + id + ", topicTitle=" + topicTitle
				+ ", topicString=" + topicString + ", topicCreateTime="
				+ topicCreateTime + ", uid=" + uid + ", topicUserName="
				+ topicUserName + ", topicStatus=" + topicStatus
				+ ", topicBrowseCount=" + topicBrowseCount
				+ ", topicContentCount=" + topicContentCount
				+ ", topicUserCount=" + topicUserCount + ", topicGreatCount="
				+ topicGreatCount + ", productId=" + productId + ", product="
				+ product.toString()+", topicHot=" + topicHot + "]";
	}



	
	
	
	
}
